Px7Table is a TTable descendant with an added method to make use of the new Pdox7 descending indices. With this type of index, you can determine the sortorder for every single field in the index. ------------------------------------------------------------------ Installation: rename either PX7TABLE.D16 or D32 to PX7TABLE.DCR. Copy the files to your directory for add-on compoments and add PX7TABLE.PAS to your component library (see Delphi manuals for details). ------------------------------------------------------------------ Added methods: AddPx7Index works just like TTable.Addindex except for an additional string parameter named DescFields: procedure AddPx7Index(const Name, Fields, DescFields: string; Options: TIndexOptions); With ixDescending in Options DescFields holds the list of fields that will actually be indexed descending, i.e. for a full descending index it equals the Fields parameter. The following example creates an index that is descending on the 1st and 3rd and ascending on the 2nd field: Px7Table1.AddPx7Index('AscDescMix', 'Field1;Field2;Field3', 'Field1;Field3', [ixDescending]); This one can be used to retrieve a list of descending fields in an index (useful for recreation of indices in code): function GetDescFields(const IxName: string): string; It returns a string holding the fieldnames seperated by ';'. ------------------------------------------------------------------ procedure SetLevel(ALevel: string); As it turned out that TUTILITY.DLL v2.52 (the one that ships with PfW7 for Win3.1x) not only drops indices when rebuilding a table but sets the table level back to 5, I added a method to set the table level. This call makes your Paradox table a level 7 table: Px7Table1.SetLevel('7'); NOTE the table has to be opened exclusive for this call. function GetLevel: string; A GetLevel method was added for completeness. Both use strings for input/output. ------------------------------------------------------------------ Note on the internals of setting desc indices...: The sortorder of a field in the index is determined by setting the correspondent entry in IDXDesc.iUnUsed to 1 for descending or to 0 for ascending. There is one entry in iUnUsed for every field in IDXDesc.aiKeyFld (i.e. for every field in the key...). The arrays for the above example would look like this: aiKeyFld = (1,2,3); iUnUsed = (1,0,1); NOTE WIN32: abDescending is used instead of iUnUsed! See the code for EncodePx7IndexDesc for more details. Reinhard Kalinke [100417.3504@compuserve com] (c) 1996-97